* DO FILE *
* Joao Antonio DOS SANTOS LIMA *

* Commands used to analyze the allocation of the Brazilian humanitarian cooperation *
import excel "Dataset - before stata.xls", sheet("Dataset - JdosSantosLima") firstrow, clear
encode Region, gen(Region_group)
encode CountryCode, gen(country1)
move country1 CountryCode
xtset country1 year

* Logistc regression *
* using food_security *
xtlogit Donation_dummy Deaths_Affected_ln food_security Pop_ln polity2 LAC_dummy Portuguese_Dummy Exp_ln i.year, re
* using GNI pc PPP *
xtlogit Donation_dummy Deaths_Affected_ln GNIppp_ln Pop_ln polity2 LAC_dummy Portuguese_Dummy Exp_ln i.year, re

* Transforming value in logarithm *
gen VALUE_LN = ln( VALUE_USD)
move VALUE_LN SumofTotaldeaths
replace VALUE_USD=. if VALUE_USD==0

* GLS regression using food_security *
xtreg VALUE_LN Deaths_Affected_ln food_security Pop_ln polity2 LAC_dummy Portuguese_Dummy Exp_ln i.year
* + Haiti dummy *
xtreg VALUE_LN Deaths_Affected_ln food_security Pop_ln polity2 LAC_dummy Haiti_dummy Portuguese_Dummy Exp_ln i.year

* GLS regression using GNI pc PPP *
xtreg VALUE_LN Deaths_Affected_ln GNIppp_ln Pop_ln polity2 LAC_dummy Portuguese_Dummy Exp_ln i.year
* + Haiti dummy *
xtreg VALUE_LN Deaths_Affected_ln GNIppp_ln Pop_ln polity2 LAC_dummy Haiti_dummy Portuguese_Dummy Exp_ln i.year

graph box VALUE_LN, marker(1, mlabel ( Code )) by(Region_group)

clear all

